<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get('think', function () {
    return 'hello,ThinkPHP8!';
});

Route::get('hello/:name', 'index/hello');
Route::get('login', function () {
    return 'login page!';
});
// Route::get('users/:id', 'user.User/read');
Route::group('api', function () {
    Route::group('users', function () {
        Route::group('users', function () {
            Route::get('/', 'user.User/index');
        });
        Route::group('addresses', function () {
            Route::get('', 'user.Address/index');
        });
    });
});
// Route::group('products', function () {
//     Route::get('', 'Product/index');
//     Route::get(':id', 'Product/read');
//     Route::post('', 'Product/save');
//     Route::put(':id', 'Product/update');
//     Route::get(':id', 'Product/delete');
// });

// Route::post('login', 'Index/login');

// Route::group('api', function () {
//     Route::getGroup('blogs', function () {
//         Route::get('', 'Blog/index');
//         Route::get(':id', 'Blog/read');
//         Route::post('', 'Blog/save');
//         Route::put(':id', 'Blog/update');
//         Route::get(':id', 'Blog/delete');
//     });
// });
